#include "ProductComputer.h"
#include <QDebug>

#include "UI/ModRun/Output/FactoryOutput.h"

//电脑产品;
ProductComputer::ProductComputer(std::shared_ptr<InterFaceCompany> pCompany,
    std::shared_ptr<InterFaceComputer> pComputer,
    std::shared_ptr<InterFacePrice> pPrice)
{
    m_pCompany = pCompany;
    m_pComputer = pComputer;
    m_pPrice = pPrice;
}

ProductComputer::~ProductComputer()
{

}

void ProductComputer::ProductSale()
{
    QString strOutput = "ProductComputer::ProductSale:销售电脑产品:";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }

    if (m_pCompany)
    {
        m_pCompany->CompanyName();
    }

    if (m_pComputer)
    {
        m_pComputer->ComputerType();
    }

    if (m_pPrice)
    {
        m_pPrice->PriceType();
    }
}


